<?php

setlocale(LC_ALL, 'ru_RU.UTF-8');
//setlocale(LC_ALL, 'russia');

date_default_timezone_set('Europe/Kiev');

defined('ROOT')
    || define('ROOT', realpath(dirname(__FILE__)));

    
defined('APPLICATION_ROOT')
    || define('APPLICATION_ROOT', realpath(dirname(__FILE__) . "/../"));
    

// Define path to application directory
defined('APPLICATION_PATH')
    || define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application'));

// Define application environment
defined('APPLICATION_ENV')
    || define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));

    
set_include_path(implode(PATH_SEPARATOR, array(
    realpath(APPLICATION_PATH . '/../library'),
    realpath(APPLICATION_PATH . '/modules/default/models'),
    realpath(APPLICATION_PATH . '/modules'),
//    realpath(APPLICATION_PATH . '/modules/default/controllers/'),
    get_include_path(),
)));


/** Zend_Application */
require_once 'Zend/Application.php';

  

// Create application, bootstrap, and run
$application = new Zend_Application(
    APPLICATION_ENV, 
    APPLICATION_PATH . '/configs/application.ini'
);

try
{
$application->bootstrap()->run();
            
}
catch (Exception $exception)
{
echo nl2br(   "Exception: \n--Message:" . $exception->getMessage() . "\n--Stack trace:"  . $exception->getTraceAsString() );       
        
}